使用社交账号登录
Chocolatey 是一个 Windows 下的软件包管理器,让用户可以像在类 Unix 系统中使用 Yum 和 APT 一样使用它,在 Windows 中实现自动化轻松管理 Windows 软件的所有方面(安装,配置,升级和卸载)。[^1]

Windows 7+ / Windows Server 2003+
PowerShell v2+
.NET Framework 4+
使用 CMD(命令提示符) 安装
以管理员身份运行 cmd。
复制以下命令并在命令提示符窗口中右键以粘贴(Windows 10 用户可直接使用 Ctrl + V 粘贴)回车并等待执行完毕。
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
使用 Powershell 安装
以管理员身份运行 Powershell。
复制以下命令并在命令提示符窗口中右键以粘贴(Windows 10 用户可直接使用 Ctrl + V 粘贴),回车并等待执行完毕。
关闭命令行窗口并重新打开
执行 choco 命令
如果您的窗口输出了类似于如下内容,那么恭喜你,安装成功!
Chocolatey v0.10.15
Please run 'choco -?' or 'choco <command> -?' for help menu.
由于 Chocolatey 安装部分软件需要管理员权限,无法直接申请,强烈推荐使用 Chocolatey 时以管理员身份运行命令提示符或 Powershell。
如果您不太会使用 CLI(命令行工具),您可以执行
choco install chocolateygui以安装 GUI 版本,安装完成后会在桌面自动创建快捷方式。
list 列出远程或本地包
find 列出远程或本地包
search 搜索远程或本地包
info 检索包信息
install 从各种来源安装包
pin 抑制包的升级
outdated 检索过时的包
upgrade 从各种来源升级包
uninstall 卸载软件包
pack 将 nuspec 打包到已编译的 nupkg
push 推送编译的 nupkg
new 从模板生成包所需的文件
sources 查看和配置默认源
source 查看和配置默认源
config 检索并配置配置文件设置
featute 查看和配置 choco 功能
features 查看和配置 choco 功能
setapikey 检索或保存特定源的 apikey
apikey 检索或保存特定源的 apikey
unpackself 让 Chocolatey 自动设置
version [将被弃用]
update [将被已弃用]
此处所有命令需带上
choco前缀执行。
例:choco install git,执行此命令可安装 Git
Get-ExecutionPolicyRestrictedSet-ExecutionPolicy AllSignedSet-ExecutionPolicy Bypass -Scope Process
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))